/******************************************************************************
* This file is part of is32p218 platform,
* Copyright (c) 2009 HangZhou InfoStrong CO.,LTD. All rights reserved.
* This software may only be used under the terms of a valid, current,
* end user license from InfoStrong.
* Nothing else gives you the right to use this software.   
*
* Name:   drv_pwm.c
* Desc:   PWM module driver c file
* Author: Jerry
* Date:   2009-9-16
* Note:   
* History:
*
******************************************************************************/
#include "def.h"
#include "option.h"
#include "xn5106x.h"
#include "drv_pwm.h"

/*
* Function Name:
*   drv_pwm_ena
* Description:
*   PMW enable/disable
* Parameters:
*   BOOL flg:
* Returns:
* Author				Date 
*  Jerry				2009-9-16   
* Note:
*    
*/
void drv_pwm_ena( BOOL flg )
{
	if (flg)
	{
		rPWMCON |= (BIT0|BIT1);	/* Clear PWM counter and Enable*/
	}
	else
	{
		rPWMCON &= (~BIT0);
	}
}

/*
* Function Name:
*   drv_pwm_init
* Description:
*   
* Parameters:
* Returns:
* Author				Date 
*  Jerry				2009-9-16   
* Note:
*    
*/
void drv_pwm_init( void )
{
	rPWMCON=0x00;				/* non-devided, 8bit counter, PWM disable */
	rPWMDAT=0x00;				/* Data setting */
}

/*
* Function Name:
*   drv_pwm_check
* Description:
*   
* Parameters:
* Returns:
* Author				Date 
*  feye 				2010-6-2   
* Note:
*    
*/
BOOL drv_pwm_check( void )
{
	return TRUE;
}

